<template>
    <div>
        <header>
            <router-link to="/cards"><van-icon name="arrow-left" class="i1" /></router-link>
            <h4>提交订单</h4>
        </header>
        <main>
            <article>
                <div>
                    <div class="left">
                        <img :src="this.$route.query.item.cardImg" alt="">
                    </div>
                    <section>
                        <h5>{{ this.$route.query.item.cardName }}{{ this.$route.query.item.countAll }}次/{{
                            this.$route.query.item.price }}
                        </h5>
                        <p>
                            <span>卡项</span>
                            <b>￥{{ this.$route.query.item.price }}*1</b>
                        </p>
                        <p>￥<i>{{ this.$route.query.item.price }}</i></p>
                    </section>
                </div>
                <p class="detail">
                    <van-cell is-link @click="showPopup">
                        查看详情
                    </van-cell>
                    <van-icon name="
                    arrow" class="i2" />
                </p>
            </article>
        </main>
        <van-popup v-model="show" closeable round position="bottom" :style="{ height: '80%' }" class="popup">
            <div class="details">
                <h2>卡项详情</h2>
                <section>
                    <div class="photo">
                        <p>{{ this.$route.query.item.cardName }}{{ this.$route.query.item.countAll }}次/{{ this.$route.query.item.price }}
                        </p>
                        <p>￥<span>{{ this.$route.query.item.price }}</span>/{{ this.$route.query.item.countAll }}次</p>
                        <p>永久有效</p>
                    </div>
                    <p class="p1">
                        {{ this.$route.query.item.cardName }}{{ this.$route.query.item.countAll }}次/{{ this.$route.query.item.price }}
                    </p>
                    <p class="p2">{{ this.$route.query.item.cardName }}</p>
                    <p class="p3">￥<b>{{ this.$route.query.item.price }}</b></p>
                </section>
                <article>
                    <h4>卡项内容</h4>
                    <div class="power">
                        <h6>卡项权益</h6>
                        <div>
                            <img :src="this.$route.query.item.cardImg" alt="">
                            <div class="face">
                                <p>{{ this.$route.query.item.cardName }}</p>
                                <p><span>{{ this.$route.query.item.countAll }}次</span>面议</p>
                            </div>
                        </div>
                    </div>
                </article>
                <aside>
                    <h4>使用说明</h4>
                    <div class="content">
                        <p>预约信息：请你提前30分钟预约</p>
                        <p>适用人数：每张团购券最多一人使用</p>
                        <p>适用人群：男女通用</p>
                    </div>
                </aside>
            </div>

        </van-popup>
        <footer>
            <p>需支付：<span>￥<b>{{ this.$route.query.item.price }}</b></span></p>
            <button @click="goto(item)">提交订单</button>
        </footer>
    </div>
</template>

<script>
import Vue from 'vue';
import { Swipe, SwipeItem } from 'vant';
import { Icon } from 'vant';
import { Popup, Cell } from 'vant';
Vue.use(Popup);
Vue.use(Icon);
Vue.use(Cell)
Vue.use(Swipe);
Vue.use(SwipeItem);

export default {
    data() {
        return {
            show: false,
            item: this.$route.query.item
        }
    },
    methods: {
        showPopup() {
            this.show = true
        },
        goto(item) {
            // console.log(this.$route,'222');
            // console.log(this.$route.query.item,'qq');
            this.$router.push({ path: '/payment', query: { item: item } })
        }
    },
    // mounted() {
    //     console.log(this.$route.query.item);
    // }
}
</script>

<style scoped>
header {
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
    margin-bottom: 10px;
}

.i1 {
    font-size: 24px;
    color: #333;
}

h4 {
    font-size: 24px;
    font-weight: normal;
    margin-left: 20px;
    line-height: 44px;
    height: 44px;
}

main {
    padding-top: 44px;
    padding-bottom: 44px;
    width: 100%;
    height: 100%;
}

main img {
    width: 120px;
    border-radius: 10px;
    line-height: 120px;
}

.left {
    height: 120px;
    line-height: 120px;
}

main article {
    display: flex;
    position: relative;
}

main article>div {
    display: flex;
    width: 100%;
}

main section {
    margin-left: 5px;
}

h5 {
    font-size: 16px;
    color: #333;
    height: 16px;
}

section>p:nth-of-type(1) {
    display: flex;
}

section>p:nth-of-type(1) span {
    font-size: 12px;
    color: rgb(232, 8, 8);
    border: 1px solid rgb(232, 8, 8);
    background: pink;
    width: 40px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    margin-right: 20px;
    border-radius: 10px;
}

section>p:nth-of-type(1) b {
    font-size: 14px;
    color: #333;
    font-weight: normal;
}

section>p:nth-of-type(2) {
    font-size: 12px;
    color: #ee0c0c;
}

section>p:nth-of-type(2) i {
    font-style: normal;
    font-size: 24px;
    font-weight: bolder;
}

.detail {
    display: flex;
    position: absolute;
    right: 0;
    top: -30px;
}

van-cell {
    font-size: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    line-height: 16px;
    height: 16px;
    text-align: center;
    font-weight: normal;
    width: 30px;
}

.popup {
    width: 100%;
    background: #f2f2f2;
    transform: translate(-10px,10px);
}

.popup h2 {
    width: 100%;
    height: 44px;
    font-size: 24px;
    color: #333;
    line-height: 44px;
    margin-left: 20px;
    background: #fff;
}

.popup section {
    height: 200px;
    width: 100%;
    margin-left: 20px;
    margin-bottom: 10px;
    background: #fff;
}

.details .photo {
    width: 120%;
    height: 200px;
    background: url(https://img2.baidu.com/it/u=3048033383,3549037764&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500) no-repeat;
    background-size: 100% 100%;
    border-radius: 10px;
    color: #fff;
    overflow: hidden;
}

.photo p:nth-of-type(1) {
    font-size: 28px;
    height: 50px;
    line-height: 50px;
    margin-left: 20px;
    width: 100%;
    margin-top: 10px;
}

.photo p:nth-of-type(2) {
    font-size: 20px;
    height: 50px;
    line-height: 50px;
    margin-left: 20px;
}

.photo p:nth-of-type(2) span {
    font-size: 28px;
}

.photo p:nth-of-type(3) {
    margin-left: 20px;
    font-size: 14px;
    height: 30px;
    line-height: 30px;
}

.details>section .p1 {
    font-size: 18px;
    color: #333;
    height: 20px;
    line-height: 20px;
}

.details>section .p2 {
    font-size: 14px;
    color: #666;
    height: 16px;
    line-height: 16px;
}

.details>section .p3 {
    font-size: 12px;
    color: #ee0505;
    height: 20px;
    line-height: 20px;
}

.details>section .p3 b {
    font-size: 20px;
    color: #f40909;
}

.details article {
    margin-top: 110px;
    background: #fff;
    width: 100%;
}

.details article h4 {
    color: #444;
    font-size: 16px;
    width: 100%;
    height: 20px;
    line-height: 20px;
    padding-left: 10px;
    border-left: 2px solid #ee0505;
}

.details article .power {
    margin-left: 20px;
}

h6 {
    font-size: 14px;
}

.power>div img {
    width: 40px;
    height: 40px;
    margin-right: 20px;
}

.power .face p:nth-of-type(1) {
    font-size: 14px;
    color: #333;
    margin-bottom: 20px;
}

.power .face p:nth-of-type(2) {
    font-size: 14px;
    color: #777;
}

.power .face p:nth-of-type(2) span {
    font-size: 14px;
    color: #ee0505;
}

.details article .power>div {
    display: flex;
    align-items: center;
}

.details aside h4 {
    color: #444;
    font-size: 16px;
    width: 100%;
    height: 20px;
    line-height: 20px;
    padding-left: 10px;
    border-left: 2px solid #ee0505;
}

.content {
    margin-left: 20px;
    width: 100%;
    padding-bottom: 20px;
}

.content p {
    font-size: 12px;
    color: #555;
    height: 18px;
    line-height: 18px;
}

footer {
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
    background: #fff;
    position: absolute;
    bottom: 0;
    left: 0;
}

footer p {
    font-size: 16px;
    color: #666;
    line-height: 44px;
    height: 44px;
}

footer p span {
    color: #e81616;
    font-size: 12px;
    margin-left: 10px;
}

footer p span>b {
    font-size: 24px;
}

footer button {
    width: 200px;
    height: 40px;
    border: none;
    font-size: 18px;
    background: none;
    text-align: center;
    line-height: 40px;
    border-radius: 20px;
    color: #fff;
    background: #e81616;
    outline: none;
    margin-left: 40px;
}</style>